
<template>
  <div class="myMain">
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <template v-for="item in nowBreadcrumb">
        <el-breadcrumb-item :to="{ path: item.path }">{{
          item.name
        }}</el-breadcrumb-item>
      </template>
    </el-breadcrumb>
    <router-view></router-view>
  </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";

const { mapMutations, mapState } = createNamespacedHelpers("publicStore");

export default {
  computed: {
    ...mapState(["nowBreadcrumb"]),
  },
  created() {
    this.setNowBreadcrumb("adduser");
    const userInfo = JSON.parse(localStorage.getItem("userInfo"));
    const { account, role } = userInfo;
    this.account = account;
    this.role = role;
    // console.log(userInfo);
  },
  methods: {
      ...mapMutations(["switchIsCollapse", "setNowBreadcrumb"]),
  },
};
</script>
